import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestExpressApplication } from '@nestjs/platform-express';
import { join } from 'path';

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  // 设置默认前缀
  // app.setGlobalPrefix('api');

  // 设置静态资源路径访问前缀
  app.useStaticAssets(join(__dirname, '..', 'public/uploads'), {
    prefix: '/static',
  });
  await app.listen(1222);
}
bootstrap();
